package com.ccs.onlinemusic.server;


import com.ccs.onlinemusic.mapper.LoveMusicMapper;
import com.ccs.onlinemusic.model.Music;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LoveMusicServer {

    @Autowired
    private LoveMusicMapper loveMusicMapper;

    public Music findLoveMusicByMusicIdAndUserId(int userId, int musicId){
        return loveMusicMapper.findLoveMusicByMusicIdAndUserId(userId,musicId);
    }

    public boolean insertLoveMusic(int userId,int musicId){
        return loveMusicMapper.insertLoveMusic(userId,musicId);
    }


    public List<Music> findLoveMusicByUserId(int userId){
        return loveMusicMapper.findLoveMusicByUserId(userId);
    }

    public List<Music> findLoveMusicByKeyAndUID(String musicName,int userId){
        return loveMusicMapper.findLoveMusicByKeyAndUID(musicName,userId);
    }

    public int deleteLoveMusic(int userId,int musicId){
        return loveMusicMapper.deleteLoveMusic(userId,musicId);
    }

}
